<script setup lang="ts">
const { money = 5000 } = defineProps<{
    money: number
}>()

const emits = defineEmits(["add", 'reduce'])

const add = () => {
    emits("add", 1000)
}

const reduce = () => {
    emits("reduce", 2000)
}
</script>

<template>
    <h1>子组件 - {{ money }}</h1>
    <button @click="add">点我加1000</button>
    <button @click="reduce">点我扣2000</button>
</template>